﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Negocios;

namespace Testes
{
    /// <summary>
    /// Summary description for AudioTeste
    /// </summary>
    [TestClass]
    public class AudioTeste
    {
        public AudioTeste()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteNomeMaiorInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("", "teste", new Genero(), new Autor(), new Album(), new Formato(), new Especificacao(), new SoftwareDeReproducao(), new Usuario());
            aBLL.Insere(a);

        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteNomeMaiorInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio ("lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll", "teste", new Genero(), new Autor(), new Album(), new Formato(), new Especificacao(), new SoftwareDeReproducao(), new Usuario());
            aBLL.Insere(a);
        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteGeneroInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("aaa", "teste", null, new Autor(), new Album(), new Formato(), new Especificacao(), new SoftwareDeReproducao(), new Usuario());
            aBLL.Insere(a);

        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteAutorInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("aaa", "teste", new Genero(), null, new Album(), new Formato(), new Especificacao(), new SoftwareDeReproducao(), new Usuario());
            aBLL.Insere(a);

        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteAlbumInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("aaa", "teste", new Genero(), new Autor(), null, new Formato(), new Especificacao(), new SoftwareDeReproducao(), new Usuario());
            aBLL.Insere(a);

        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteFormatoInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("aaa", "teste", new Genero(), new Autor(), new Album(), null, new Especificacao(), new SoftwareDeReproducao(), new Usuario());
            aBLL.Insere(a);

        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteEspecificacaoInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("aaa", "teste", new Genero(), new Autor(), new Album(), new Formato(), null, new SoftwareDeReproducao(), new Usuario());
            aBLL.Insere(a);

        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteSoftwareDeReproducaoInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("aaa", "teste", new Genero(), new Autor(), new Album(), new Formato(), new Especificacao(), null, new Usuario());
            aBLL.Insere(a);

        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteUsuarioInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("aaa", "teste", new Genero(), new Autor(), new Album(), new Formato(), new Especificacao(), new SoftwareDeReproducao(), null);
            aBLL.Insere(a);

        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteGeneroDesconhecidoInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("llllll", "teste", new Genero(0), new Autor(), new Album(), new Formato(), new Especificacao(), new SoftwareDeReproducao(), new Usuario());
            aBLL.Insere(a);
        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteAutorDesconhecidoInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("llllll", "teste", new Genero(), new Autor(0), new Album(), new Formato(), new Especificacao(), new SoftwareDeReproducao(), new Usuario());
            aBLL.Insere(a);
        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteAlbumDesconhecidoInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("llllll", "teste", new Genero(), new Autor(), new Album(0), new Formato(), new Especificacao(), new SoftwareDeReproducao(), new Usuario());
            aBLL.Insere(a);
        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TestFormatoDesconhecidoInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("llllll", "teste", new Genero(), new Autor(), new Album(), new Formato(0), new Especificacao(), new SoftwareDeReproducao(), new Usuario());
            aBLL.Insere(a);
        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteEspecificacaoDesconhecidoInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("llllll", "teste", new Genero(), new Autor(), new Album(), new Formato(), new Especificacao(0), new SoftwareDeReproducao(), new Usuario());
            aBLL.Insere(a);
        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteSoftwareDeReproducaoDesconhecidoInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("llllll", "teste", new Genero(), new Autor(), new Album(), new Formato(), new Especificacao(), new SoftwareDeReproducao(0), new Usuario());
            aBLL.Insere(a);
        }
        [TestMethod]
        [ExpectedException(typeof(SystemException))]
        public void TesteUsuarioDesconhecidoInsercaoAtualiza()
        {
            AudioBLL aBLL = new AudioBLL();
            Audio a = new Audio("llllll", "teste", new Genero(), new Autor(), new Album(), new Formato(), new Especificacao(), new SoftwareDeReproducao(), new Usuario(0));
            aBLL.Insere(a);
        }
     }
}
